package com.baizhi.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
@Slf4j  // 相当于在这个类中声明了一个日志对象
public class UserController {
    // private Logger log = LoggerFactory.getLogger(this.getClass());

    @RequestMapping("hello")
    public String hello(String name, Integer age) {
        log.info("进入hello方法");
        log.info("进入{}类的{}方法", "User", "hello");
        log.info("姓名：{}, 年龄：{}", name, age);
        return "Hello World";
    }

    // JRebel热部署
    @RequestMapping("test")
    public void test() {
        log.info("进入test方法");
        System.out.println("test jrebel");
    }
}
